__author__ = "ncll"
__data__ = "2020/11/11 8:42"
# 帮助 help(str.count)
# find():从左往右找字符串  找不到返回1
# rfind():从右往左找字符串 找不到返回1
# index():从左往右找字符串 找不到报错
# rindex():从左往右找字符串 找不到报错
# count():查找个数
# repalce():替换几个
# split():分割
# + : 拼接
# capitalize():首字母大写   title():把所有的首字母都大写
# startswith():以什么字母开头，是返回TRUE,否返回FLASE
# endswith():以什么字母开头，是返回TRUE,否返回FLASE
# upper():把所有字母大写 lower()：把所有字母小写
# ljust：填充右边  rjust：填充左边  center：填充中间
# strip():去掉两端空格 rstrip():去掉右端空格  lstrip():去掉左端空格
# join():合并字符串

aStr = "hello chenlu ni hao"

aStr1 = aStr.split(" ")
print(aStr1[-2])
print(aStr1)

my_str = ["123", "456"]
print("qq".join(my_str))


# my_str = " ab  cdB  "
#
# print(my_str.ljust(9, "p"))
# print(my_str.rjust(9, "p"))
# print(my_str.center(9, "p"))
# print(my_str.strip())
# print(my_str.rstrip())
# print(my_str.lstrip())

# print(my_str.capitalize())
# print(my_str.title())
# print(my_str.startswith("a"))
# print(my_str.endswith("dd"))
# print(my_str.upper())
# print(my_str.lower())
# my_str = "abcadefga"
# print(my_str.find("a"))
# print(my_str.rfind("a"))
# print(my_str.index("a"))
# print(my_str.rindex("a"))
# print(my_str.count("a"))
# print(my_str.replace("a", "1", 1))
# print(my_str.split("a"))
# str1 = my_str[3:6]
# print(str1.replace("a","1"))

# print(my_str[::-1])
# print(my_str[2:5])    # 默认步长是1，默认从头到尾
# print(my_str[5:2:-1])




